package com.example.demo.spider;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @author lyc
 * @date 2019/9/27.
 */
@Component
public class Spider01 {

    public static String url = "https://niocoder.com/categories/#Security";
    public static void main(String[] args) throws IOException {
        Document doc = Jsoup.connect(url)
                .data("query", "Java")
                .userAgent("Mozilla")
                .cookie("auth", "token")
                .timeout(3000)
                .get();

        System.out.println(doc.text());
    }
}